package redis

func (k *key) SetBit(offset, value int) IntResult {
	return k.cmd("SETBIT", k.key, offset, value)
}

func (k *key) GetBit(offset int) IntResult {
	return k.cmd("GETBIT", k.key, offset)
}

func (k *key) BitCount() IntResult {
	return k.cmd("BITCOUNT", k.key)
}

func (k *key) BitCountRange(start, end int) IntResult {
	return k.cmd("BITCOUNT", k.key, start, end)
}

func (k *key) BitPos(bit int) IntResult {
	return k.cmd("BITPOS", k.key, bit)
}

func (k *key) BitPosRange(bit, start, end int) IntResult {
	return k.cmd("BITPOS", k.key, bit, start, end)
}

func (k *key) BitOp(op string) IntResult {
	args := []any{op}
	for _, kk := range k.keys {
		args = append(args, kk)
	}
	return k.cmd("BITOP", args...)
}
